<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>

        // 修饰符
        //   i   ignore   忽视大小写
        //   g   global   全局匹配

        // let reg = /good/i ;   // 忽略大小写

        // let reg = /good/g ;   // 全局匹配

        let reg = /good/ig ;    // ig / gi 都可以

        let str = 'Good' ;

        console.log(reg.test(str));

    </script>
    
</body>
</html>